package com.goukakuproject;

import com.leftMenuHelper.Lession;
import com.leftMenuHelper.LessionAdapter;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ListView;

public class GKVocablisttab extends Activity {
	private ListView listViewVocab;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.layout_gkvocablisttab);		
		Lession lessonData[] = new Lession[10];       
        for (int i = 0; i< 10; i++){
        	lessonData[i] =  new Lession(R.drawable.ic_launcher, "Từ số " + (i+1));
        }        
         LessionAdapter adapter = new LessionAdapter(this,R.layout.listview_item_row, lessonData);               
         listViewVocab = (ListView)findViewById(R.id.listViewVocabListTab);         
//         View header = (View)getLayoutInflater().inflate(R.layout.listview_header_row, null);         
//         listViewVocab.addHeaderView(header);        
         listViewVocab.setAdapter(adapter);         
         listViewVocab.setOnItemClickListener(new AdapterView.OnItemClickListener() {
			@Override
			public void onItemClick(AdapterView<?> arg0, View arg1, int arg2,long arg3) {
				 Intent myIntent=new Intent(GKVocablisttab.this,GKVocabsingletab.class);		 
//				 Bundle bundle=new Bundle();
//				 bundle.putInt("N", bai);
//				 bundle.putInt("Bai", arg2);
				 //myIntent.putExtra("GKLeftmenu", bundle);
				 startActivity(myIntent);
			}
			
		});
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.gkvocablisttab, menu);
		return true;
	}

}
